<template>
    <div>
        <count-to :end-val="endVal">
            <span slot="left">总金额:</span>
            <span slot="right">元</span>
        </count-to>
        <button @click="updataVal">更新值</button>
    </div>
</template>

<script>
import countTo from '../components/countTo';
export default {
    data() {
        return {
            endVal:100
        };
    },
    mounted() {
        
    },
    methods: {
        updataVal(){
            this.endVal +=Math.random()*100
        }
    },
     components: {countTo},
};
</script>

<style lang="scss" scoped>

</style>